<template>
  <div>
    <h3>孙子组件</h3>
    <ul>
      <li>{{ count }}</li>
    </ul>
    <button @click="count++">修改注入的数据</button>
  </div>
</template>

<script>
import { inject } from 'vue'
export default {
  setup () {
    // 接收爷爷数=》写法：const 变量名 = inject('count1')
    const count = inject('count1')
    return { count }
  }
}
</script>

<style lang="scss" scoped>
</style>
